﻿
/****** Object:  Table [dbo].[myAudit]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myAudit](
[actionkey] [varchar](50) NULL,
[RevisionStamp] [datetime] NULL,
[ExtraInfo] [nchar](300) NULL,
[ExtraSystemInfo] [varchar](500) NULL,
[TableName] [varchar](50) NULL,
[Actions] [varchar](1) NULL,
[ChangedColumns] [varchar](1000) NULL,
[OldData] [xml] NULL,
[NewData] [xml] NULL,
[AuditId] [uniqueidentifier] NOT NULL,
[BusinessObjectKey] [varchar](255) NULL,
[GuidBusinessObject] [uniqueidentifier] NULL,
[GuidUser] [uniqueidentifier] NULL,
CONSTRAINT [PK_myAudit] PRIMARY KEY CLUSTERED
(
[AuditId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myAuditProperties]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myAuditProperties](
[AuditId] [uniqueidentifier] NOT NULL,
[PropertyName] [varchar](100) NOT NULL,
[PropertyValueInt] [int] NULL,
[PropertyValueText] [varchar](max) NULL,
[propertyValueGuid] [uniqueidentifier] NULL,
[propertyValueBinary] [varbinary](max) NULL,
[PropertyType] [varchar](255) NULL,
[PropertyDisplay] [varchar](max) NULL,
[PropertyValue] [varchar](max) NULL,
[GuidProperty] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_myAuditProperties] PRIMARY KEY CLUSTERED
(
[GuidProperty] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myConfiguration]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myConfiguration](
[ConfigurationKey] [varchar](50) NULL,
[ValueInt] [int] NULL,
[ValueString] [varchar](300) NULL,
[Name] [varchar](300) NOT NULL,
[NameLocalizable] [varchar](max) NULL,
[GuidConfiguration] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_myConfiguration] PRIMARY KEY CLUSTERED
(
[GuidConfiguration] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [XConfigurationKey] UNIQUE NONCLUSTERED
(
[ConfigurationKey] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myContentBusinessObjects]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[myContentBusinessObjects](
[GuidContent] [uniqueidentifier] NOT NULL,
[GuidBusinessObject] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_myContentBusinessObjects_1] PRIMARY KEY CLUSTERED
(
[GuidContent] ASC,
[GuidBusinessObject] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[myContentMenus]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myContentMenus](
[GuidContent] [uniqueidentifier] NOT NULL,
[MenuKey] [varchar](50) NOT NULL,
[GuidContentMenu] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_myContentMenus] PRIMARY KEY CLUSTERED
(
[GuidContentMenu] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myContentRelations]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[myContentRelations](
[GuidContent] [uniqueidentifier] NOT NULL,
[GuidParent] [uniqueidentifier] NOT NULL,
[OrderParent] [int] NULL,
[GuidContentsRelation] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_myContentRelations] PRIMARY KEY CLUSTERED
(
[GuidContentsRelation] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[MyContents]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyContents](
[GuidContent] [uniqueidentifier] NOT NULL,
[Title] [varchar](255) NULL,
[LargeContent] [varchar](max) NULL,
[ModuleKey] [varchar](50) NULL,
[CreatedDate] [datetime] NULL,
[CreatedUser] [int] NULL,
[UpdatedDate] [datetime] NULL,
[PropertyName] [varchar](50) NULL,
[BusinessObjectKey] [varchar](50) NULL,
[OrderContent] [int] NULL,
[UseMode] [varchar](50) NULL,
[ActionKey] [varchar](50) NULL,
[MenuKey] [varchar](50) NULL,
[Slug] [varchar](100) NULL,
[GuidContentType] [uniqueidentifier] NULL,
CONSTRAINT [PK_MyContents] PRIMARY KEY CLUSTERED
(
[GuidContent] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myContentType]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myContentType](
[Name] [varchar](255) NULL,
[ContentTypeKey] [varchar](20) NULL,
[GuidContentType] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_myContentType] PRIMARY KEY CLUSTERED
(
[GuidContentType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myEventLog]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myEventLog](
[Timestamp] [datetime] NULL,
[Message] [varchar](max) NOT NULL,
[Category] [int] NULL,
[Priority] [int] NULL,
[EventId] [int] NULL,
[Severity] [int] NULL,
[Title] [varchar](300) NULL,
[Machine] [varchar](300) NULL,
[ApplicationDomain] [varchar](300) NULL,
[ProcessId] [varchar](300) NULL,
[ProcessName] [varchar](300) NULL,
[Win32ThreadId] [varchar](300) NULL,
[ThreadName] [varchar](300) NULL,
[ExtendedProperties] [varchar](max) NULL,
[ActionType] [int] NULL,
[IsException] [bit] NULL,
[GuidMyEventLog] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_myEventLog] PRIMARY KEY CLUSTERED
(
[GuidMyEventLog] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[MyFilterQueries]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyFilterQueries](
[Title] [varchar](255) NOT NULL,
[QueryLinq] [varchar](max) NULL,
[HtmlContent] [varchar](max) NULL,
[IsShared] [bit] NULL,
[CreatedBy] [uniqueidentifier] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
[CreatedDate] [datetime] NULL,
[UpdatedDate] [datetime] NULL,
[UseMode] [varchar](50) NULL,
[GuidBusinessObject] [uniqueidentifier] NULL,
[GuidFilterQuery] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
[GuidCompany] [uniqueidentifier] NULL,
CONSTRAINT [XPKMyFilterQueries] PRIMARY KEY CLUSTERED
(
[GuidFilterQuery] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[MyGeoCities]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyGeoCities](
[Name] [varchar](300) NULL,
[OtherNames] [varchar](max) NULL,
[GuidState] [uniqueidentifier] NULL,
[GuidCity] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_MyGeoCities_1] PRIMARY KEY CLUSTERED
(
[GuidCity] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[MyGeoCountries]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyGeoCountries](
[ISO_CODE] [char](2) NULL,
[Name] [varchar](300) NULL,
[OtherNames] [varbinary](max) NULL,
[GuidCountry] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_MyGeoCountries] PRIMARY KEY CLUSTERED
(
[GuidCountry] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[MyGeoStates]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyGeoStates](
[Name] [varchar](300) NOT NULL,
[OtherNames] [varchar](max) NULL,
[Code] [nchar](4) NULL,
[GuidCountry] [uniqueidentifier] NULL,
[GuidState] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_MyGeoStates_1] PRIMARY KEY CLUSTERED
(
[GuidState] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[myOptions]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[myOptions](
[OptionKey] [varchar](50) NULL,
[Name] [varchar](300) NULL,
[NameLocalizable] [varchar](max) NULL,
[OptionValue] [int] NULL,
[Description] [varchar](max) NULL,
[DescriptionLocalizable] [varchar](max) NULL,
[GuidList] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_coreOptions] PRIMARY KEY CLUSTERED
(
[GuidList] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[MyProfile]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MyProfile](
[IdUser] [int] NOT NULL,
[FirstName] [varchar](300) NULL,
[LastName] [varchar](300) NULL,
[LastName2] [varchar](300) NULL,
[ActualAddress] [varchar](500) NULL,
[BirthDay] [datetime] NULL,
[HomePhone] [varchar](50) NULL,
[WorkPhone] [varchar](50) NULL,
[MobilePhone] [varchar](50) NULL,
[Email] [varchar](50) NULL,
[WebAddress] [varchar](300) NULL,
[IM_msn] [varchar](300) NULL,
[IM_yahoo] [varchar](300) NULL,
[IM_AIM] [varchar](300) NULL,
[IM_google] [varchar](300) NULL,
[Sex] [int] NULL,
[ExtensibleInfo] [xml] NULL,
[IdCompanyFavorite] [int] NULL,
[LocalizacionFavorite] [char](4) NULL,
[GuidActualCountry] [uniqueidentifier] NULL,
[GuidWorkCountry] [uniqueidentifier] NULL,
[GuidActualState] [uniqueidentifier] NULL,
[GuidWorkState] [uniqueidentifier] NULL,
[GuidActualCity] [uniqueidentifier] NULL,
[GuidWorkCity] [uniqueidentifier] NULL,
CONSTRAINT [PK_MyProfile] PRIMARY KEY CLUSTERED
(
[IdUser] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secBusinessObject]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secBusinessObject](
[BusinessObjectKey] [varchar](60) NULL,
[Name] [varchar](300) NULL,
[EntitySetName] [varchar](50) NULL,
[TableName] [varchar](50) NULL,
[ExtensibleInfo] [xml] NULL,
[GuidModule] [uniqueidentifier] NULL,
[GuidBusinessObject] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_secBusinessObject] PRIMARY KEY CLUSTERED
(
[GuidBusinessObject] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secCompanies]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secCompanies](
[Name] [varchar](300) NOT NULL,
[GuidCompanyType] [uniqueidentifier] NULL,
[GuidCompany] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
[CompanyParentGuid] [uniqueidentifier] NULL,
CONSTRAINT [Company_PK] PRIMARY KEY CLUSTERED
(
[GuidCompany] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secCompanyExtraData]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secCompanyExtraData](
[GuidExtraData] [uniqueidentifier] NOT NULL,
[PaypalIdOrEmail] [varchar](200) NULL,
[UpdatedDate] [datetime] NULL,
[CreatedDate] [datetime] NULL,
[PayInstructionsPhone] [varchar](1000) NULL,
[PayInstructionsPaypal] [varchar](1000) NULL,
[PayInstructionsCash] [varchar](1000) NULL,
[PayInstructionsPreCard] [varchar](1000) NULL,
[LogoFileName] [varchar](300) NULL,
[LogoFileData] [varbinary](max) NULL,
[LogoFileSize] [int] NULL,
[LogoFileType] [varchar](50) NULL,
[LegalName] [varchar](255) NULL,
[VATKey] [varchar](12) NULL,
[Address] [varchar](300) NULL,
[UpdatedBy] [uniqueidentifier] NULL,
[CreatedBy] [uniqueidentifier] NULL,
[GuidCompany] [uniqueidentifier] NULL,
CONSTRAINT [PK_secPaymentProviderData] PRIMARY KEY CLUSTERED
(
[GuidExtraData] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secCompanyModules]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secCompanyModules](
[GuidModule] [uniqueidentifier] NOT NULL,
[GuidCompany] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secCompanyModules_1] PRIMARY KEY CLUSTERED
(
[GuidModule] ASC,
[GuidCompany] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secCompanyRoles]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secCompanyRoles](
[GuidCompany] [uniqueidentifier] NOT NULL,
[GuidRole] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secCompanyRoles] PRIMARY KEY CLUSTERED
(
[GuidCompany] ASC,
[GuidRole] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secCompanyType]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secCompanyType](
[Name] [varchar](100) NULL,
[NameKey] [varchar](50) NULL,
[GuidCompanyType] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_secCompanyType] PRIMARY KEY CLUSTERED
(
[GuidCompanyType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secDataColumn]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secDataColumn](
[TableName] [varchar](100) NULL,
[ColumnName] [varchar](100) NULL,
[ColumnValue] [varchar](100) NULL,
[GuidDataColumn] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [secDataColumn_PK] PRIMARY KEY CLUSTERED
(
[GuidDataColumn] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secLoginProviders]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secLoginProviders](
[Name] [varchar](20) NULL,
[Url] [varchar](20) NULL,
[Description] [varchar](20) NULL,
[GuidLoginProvider] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [XPKsecLoginProviders] PRIMARY KEY CLUSTERED
(
[GuidLoginProvider] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secMenuForms]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secMenuForms](
[Url] [varchar](300) NULL,
[FormKey] [varchar](50) NOT NULL,
[Title] [varchar](300) NULL,
[GuidModule] [uniqueidentifier] NULL,
[GuidBusinessObject] [uniqueidentifier] NULL,
[GuidPermission] [uniqueidentifier] NULL,
[GuidForm] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
[ParentGuidForm] [uniqueidentifier] NULL,
CONSTRAINT [PK_secMenuForms] PRIMARY KEY CLUSTERED
(
[GuidForm] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secModule]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secModule](
[Name] [varchar](300) NULL,
[PathModule] [varchar](300) NULL,
[ModuleParentId] [int] NULL,
[TypeFullObject] [nvarchar](300) NULL,
[ModuleKey] [varchar](50) NOT NULL,
[ExtensibleInfo] [xml] NULL,
[ModuleNamespace] [varchar](300) NULL,
[GuidModule] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [Module_PK] PRIMARY KEY CLUSTERED
(
[GuidModule] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [IX_Module_ModuleKey] UNIQUE NONCLUSTERED
(
[ModuleKey] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secModuleObjectPermission]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secModuleObjectPermission](
[GuidModule] [uniqueidentifier] NOT NULL,
[GuidBusinessObject] [uniqueidentifier] NOT NULL,
[GuidPermission] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secModuleObjectPermission] PRIMARY KEY CLUSTERED
(
[GuidModule] ASC,
[GuidBusinessObject] ASC,
[GuidPermission] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secModulePermissions]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secModulePermissions](
[GuidModule] [uniqueidentifier] NOT NULL,
[GuidPermission] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secModulePermissions] PRIMARY KEY CLUSTERED
(
[GuidModule] ASC,
[GuidPermission] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secMoneyMovements]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secMoneyMovements](
[GuidMovement] [uniqueidentifier] NOT NULL,
[DateMovement] [datetime] NOT NULL,
[Amount] [decimal](14, 4) NOT NULL,
[UpdatedDate] [datetime] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
[CreatedBy] [uniqueidentifier] NULL,
[CreatedDate] [datetime] NULL,
[Tmp_IdCompanyCharge_4] [int] NULL,
[Comments] [varchar](255) NULL,
[Tmp_IdUserCharge_1] [int] NULL,
[GuidUserPayment] [uniqueidentifier] NULL,
[GuidCompanyAdd] [uniqueidentifier] NULL,
[GuidCompanyCharge] [uniqueidentifier] NULL,
[GuidUserCharge] [uniqueidentifier] NULL,
[GuidUserAdd] [uniqueidentifier] NULL,
[GuidMoneyMovementType] [uniqueidentifier] NULL,
CONSTRAINT [PK_secMoneyMovements] PRIMARY KEY CLUSTERED
(
[GuidMovement] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secMoneyMovementTypes]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secMoneyMovementTypes](
[NameKey] [varchar](50) NULL,
[Name] [varchar](2550) NOT NULL,
[GuidMoneyMovementType] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_secMoneyMovementTypes] PRIMARY KEY CLUSTERED
(
[GuidMoneyMovementType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secMoneyPayments]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secMoneyPayments](
[Name] [varchar](255) NULL,
[NameKey] [varchar](50) NOT NULL,
[GuidPaymentType] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_secMoneyPayments] PRIMARY KEY CLUSTERED
(
[GuidPaymentType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secPaymentMethods]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secPaymentMethods](
[Name] [varchar](255) NULL,
[NameKey] [varchar](50) NOT NULL,
[GuidPaymentMethod] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [PK_secPaymentMethods] PRIMARY KEY CLUSTERED
(
[GuidPaymentMethod] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secPermission]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secPermission](
[Name] [varchar](300) NOT NULL,
[NameLocalizable] [xml] NULL,
[PermissionKey] [varchar](50) NOT NULL,
[GuidPermission] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
CONSTRAINT [Permission_PK] PRIMARY KEY CLUSTERED
(
[GuidPermission] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [IX_Permission_PermissionKey] UNIQUE NONCLUSTERED
(
[PermissionKey] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secRoleDataPermission]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secRoleDataPermission](
[IdPermission] [int] NOT NULL,
[GuidRole] [uniqueidentifier] NOT NULL,
[GuidDataColumn] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secRoleDataPermission] PRIMARY KEY CLUSTERED
(
[IdPermission] ASC,
[GuidRole] ASC,
[GuidDataColumn] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secRoleModuleObjectPermission]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secRoleModuleObjectPermission](
[IsAllowed] [bit] NULL,
[UpdatedDate] [datetime] NULL,
[CreatedDate] [datetime] NULL,
[GuidModule] [uniqueidentifier] NOT NULL,
[GuidBusinessObject] [uniqueidentifier] NOT NULL,
[GuidRole] [uniqueidentifier] NOT NULL,
[GuidPermission] [uniqueidentifier] NOT NULL,
[CreatedBy] [uniqueidentifier] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
CONSTRAINT [PK_secRoleModuleObjectPermission_1] PRIMARY KEY CLUSTERED
(
[GuidModule] ASC,
[GuidBusinessObject] ASC,
[GuidRole] ASC,
[GuidPermission] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secRoleModulePermissions]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secRoleModulePermissions](
[UpdatedDate] [datetime] NULL,
[CreatedDate] [datetime] NULL,
[GuidModule] [uniqueidentifier] NOT NULL,
[GuidRole] [uniqueidentifier] NOT NULL,
[GuidPermission] [uniqueidentifier] NOT NULL,
[UpdatedBy] [uniqueidentifier] NULL,
[CreatedBy] [uniqueidentifier] NULL,
[IsAllowed] [bit] NULL,
CONSTRAINT [PK_secRoleModulePermissions] PRIMARY KEY CLUSTERED
(
[GuidModule] ASC,
[GuidRole] ASC,
[GuidPermission] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secRoles]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secRoles](
[RoleId] [uniqueidentifier] NULL,
[RoleName] [varchar](100) NULL,
[LoweredRoleName] [varchar](100) NULL,
[UpdatedDate] [datetime] NULL,
[CreatedDate] [datetime] NULL,
[GuidRole] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
[ParentGuidRole] [uniqueidentifier] NULL,
[CreatedBy] [uniqueidentifier] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
CONSTRAINT [Roles_PK] PRIMARY KEY CLUSTERED
(
[GuidRole] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secRoleTree]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secRoleTree](
[IdRole] [int] NOT NULL,
[ParentIdRole] [int] NULL,
CONSTRAINT [secRoleTree_PK] PRIMARY KEY CLUSTERED
(
[IdRole] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secUser_LoginProviders]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secUser_LoginProviders](
[UrlProfile] [varchar](200) NULL,
[UserName] [varchar](50) NULL,
[FavoriteName] [varchar](50) NULL,
[FirstName] [varchar](50) NULL,
[LastName] [varchar](50) NULL,
[Email] [varchar](50) NULL,
[IsEmailValid] [bit] NULL,
[GuidUser] [uniqueidentifier] NULL,
[GuidUserLoginProvider] [uniqueidentifier] NOT NULL,
[GuidLoginProvider] [uniqueidentifier] NULL,
[IdUserProvider] [varchar](100) NULL,
CONSTRAINT [XPKsecUser_LoginProviders] PRIMARY KEY CLUSTERED
(
[GuidUserLoginProvider] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secUserCompanies]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secUserCompanies](
[GuidCompany] [uniqueidentifier] NOT NULL,
[GuidUser] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secUserCompanies] PRIMARY KEY CLUSTERED
(
[GuidCompany] ASC,
[GuidUser] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secUserPayments]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secUserPayments](
[GuidUserPayment] [uniqueidentifier] NOT NULL,
[Amount] [decimal](14, 4) NULL,
[UpdatedDate] [datetime] NULL,
[CreatedDate] [datetime] NULL,
[Comments] [varchar](255) NULL,
[GuidCompany] [uniqueidentifier] NULL,
[GuidPaymentMethod] [uniqueidentifier] NULL,
[GuidUser] [uniqueidentifier] NULL,
[CreatedBy] [uniqueidentifier] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
CONSTRAINT [PK_secUserPayments] PRIMARY KEY CLUSTERED
(
[GuidUserPayment] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[secUserRoles]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[secUserRoles](
[GuidRole] [uniqueidentifier] NOT NULL,
[GuidUser] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_secUserRoles] PRIMARY KEY CLUSTERED
(
[GuidRole] ASC,
[GuidUser] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[secUsers]    Script Date: 3/27/2013 6:32:56 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[secUsers](
[UserId] [uniqueidentifier] NULL,
[UserName] [varchar](50) NULL,
[LoweredUserName] [varchar](50) NULL,
[IsAnonymous] [bit] NULL,
[LastActivityDate] [datetime] NULL,
[LastName] [varchar](300) NULL,
[FirstName] [varchar](300) NULL,
[Password] [varchar](500) NULL,
[Email] [varchar](300) NULL,
[ExtensibleInfo] [xml] NULL,
[UpdatedDate] [datetime] NULL,
[CreatedDate] [datetime] NULL,
[DisplayName] [varchar](50) NULL,
[EmailVerified] [bit] NULL,
[GuidUser] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
[GuidCompany] [uniqueidentifier] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
[CreatedBy] [uniqueidentifier] NULL,
CONSTRAINT [Users_PK] PRIMARY KEY CLUSTERED
(
[GuidUser] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UserUserId] UNIQUE NONCLUSTERED
(
[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[myAudit] ADD  CONSTRAINT [DF_myAudit_GuidUser]  DEFAULT (newid()) FOR [GuidUser]
GO
ALTER TABLE [dbo].[myConfiguration] ADD  CONSTRAINT [DF_myConfiguration_GuidConfiguration]  DEFAULT (newid()) FOR [GuidConfiguration]
GO
ALTER TABLE [dbo].[myContentType] ADD  CONSTRAINT [DF_myContentType_GuidContentType]  DEFAULT (newid()) FOR [GuidContentType]
GO
ALTER TABLE [dbo].[myEventLog] ADD  CONSTRAINT [DF_myEventLog_GuidMyEventLog]  DEFAULT (newid()) FOR [GuidMyEventLog]
GO
ALTER TABLE [dbo].[MyFilterQueries] ADD  CONSTRAINT [DF_MyFilterQueries_GuidFilterQuery]  DEFAULT (newid()) FOR [GuidFilterQuery]
GO
ALTER TABLE [dbo].[MyGeoCities] ADD  CONSTRAINT [DF_MyGeoCities_GuidCity]  DEFAULT (newid()) FOR [GuidCity]
GO
ALTER TABLE [dbo].[MyGeoCountries] ADD  CONSTRAINT [DF_MyGeoCountries_GuidCountry]  DEFAULT (newid()) FOR [GuidCountry]
GO
ALTER TABLE [dbo].[MyGeoStates] ADD  CONSTRAINT [DF_MyGeoStates_GuidState]  DEFAULT (newid()) FOR [GuidState]
GO
ALTER TABLE [dbo].[myOptions] ADD  CONSTRAINT [DF_myOptions_GuidList]  DEFAULT (newid()) FOR [GuidList]
GO
ALTER TABLE [dbo].[secBusinessObject] ADD  CONSTRAINT [DF_secBusinessObject_GuidBusinessObject]  DEFAULT (newid()) FOR [GuidBusinessObject]
GO
ALTER TABLE [dbo].[secCompanies] ADD  CONSTRAINT [DF_secCompanies_GuidCompany]  DEFAULT (newid()) FOR [GuidCompany]
GO
ALTER TABLE [dbo].[secCompanyType] ADD  CONSTRAINT [DF_secCompanyType_GuidCompanyType]  DEFAULT (newid()) FOR [GuidCompanyType]
GO
ALTER TABLE [dbo].[secDataColumn] ADD  CONSTRAINT [DF_secDataColumn_GuidDataColumn]  DEFAULT (newid()) FOR [GuidDataColumn]
GO
ALTER TABLE [dbo].[secLoginProviders] ADD  CONSTRAINT [DF_secLoginProviders_GuidLoginProvider]  DEFAULT (newid()) FOR [GuidLoginProvider]
GO
ALTER TABLE [dbo].[secMenuForms] ADD  CONSTRAINT [DF_secMenuForms_GuidForm]  DEFAULT (newid()) FOR [GuidForm]
GO
ALTER TABLE [dbo].[secModule] ADD  CONSTRAINT [DF_secModule_GuidModule]  DEFAULT (newid()) FOR [GuidModule]
GO
ALTER TABLE [dbo].[secMoneyMovementTypes] ADD  CONSTRAINT [DF_secMoneyMovementTypes_GuidMoneyMovementType]  DEFAULT (newid()) FOR [GuidMoneyMovementType]
GO
ALTER TABLE [dbo].[secMoneyPayments] ADD  CONSTRAINT [DF_secMoneyPayments_GuidPaymentType]  DEFAULT (newid()) FOR [GuidPaymentType]
GO
ALTER TABLE [dbo].[secPaymentMethods] ADD  CONSTRAINT [DF_secPaymentMethods_GuidPaymentMethod]  DEFAULT (newid()) FOR [GuidPaymentMethod]
GO
ALTER TABLE [dbo].[secPermission] ADD  CONSTRAINT [DF_secPermission_GuidPermission]  DEFAULT (newid()) FOR [GuidPermission]
GO
ALTER TABLE [dbo].[secRoles] ADD  CONSTRAINT [DF_secRoles_GuidRole]  DEFAULT (newid()) FOR [GuidRole]
GO
ALTER TABLE [dbo].[secUser_LoginProviders] ADD  CONSTRAINT [DF_secUser_LoginProviders_GuidUserLoginProvGuider]  DEFAULT (newid()) FOR [GuidUserLoginProvider]
GO
ALTER TABLE [dbo].[secUsers] ADD  CONSTRAINT [DF_secUsers_GuidUser]  DEFAULT (newid()) FOR [GuidUser]
GO
ALTER TABLE [dbo].[myAuditProperties]  WITH NOCHECK ADD  CONSTRAINT [FK_myAuditProperties_myAudit] FOREIGN KEY([AuditId])
REFERENCES [dbo].[myAudit] ([AuditId])
GO
ALTER TABLE [dbo].[myAuditProperties] CHECK CONSTRAINT [FK_myAuditProperties_myAudit]
GO
ALTER TABLE [dbo].[myContentBusinessObjects]  WITH NOCHECK ADD  CONSTRAINT [FK_myContentBusinessObjects_MyContents] FOREIGN KEY([GuidContent])
REFERENCES [dbo].[MyContents] ([GuidContent])
GO
ALTER TABLE [dbo].[myContentBusinessObjects] CHECK CONSTRAINT [FK_myContentBusinessObjects_MyContents]
GO
ALTER TABLE [dbo].[myContentBusinessObjects]  WITH CHECK ADD  CONSTRAINT [FK_myContentBusinessObjects_secBusinessObject] FOREIGN KEY([GuidBusinessObject])
REFERENCES [dbo].[secBusinessObject] ([GuidBusinessObject])
GO
ALTER TABLE [dbo].[myContentBusinessObjects] CHECK CONSTRAINT [FK_myContentBusinessObjects_secBusinessObject]
GO
ALTER TABLE [dbo].[myContentMenus]  WITH NOCHECK ADD  CONSTRAINT [FK_myContentMenus_MyContents] FOREIGN KEY([GuidContent])
REFERENCES [dbo].[MyContents] ([GuidContent])
GO
ALTER TABLE [dbo].[myContentMenus] CHECK CONSTRAINT [FK_myContentMenus_MyContents]
GO
ALTER TABLE [dbo].[myContentRelations]  WITH NOCHECK ADD  CONSTRAINT [FK_myContentRelations_MyContents] FOREIGN KEY([GuidContent])
REFERENCES [dbo].[MyContents] ([GuidContent])
GO
ALTER TABLE [dbo].[myContentRelations] CHECK CONSTRAINT [FK_myContentRelations_MyContents]
GO
ALTER TABLE [dbo].[myContentRelations]  WITH NOCHECK ADD  CONSTRAINT [FK_myContentRelations_MyContents1] FOREIGN KEY([GuidParent])
REFERENCES [dbo].[MyContents] ([GuidContent])
GO
ALTER TABLE [dbo].[myContentRelations] CHECK CONSTRAINT [FK_myContentRelations_MyContents1]
GO
ALTER TABLE [dbo].[MyContents]  WITH CHECK ADD  CONSTRAINT [FK_MyContents_myContentType1] FOREIGN KEY([GuidContentType])
REFERENCES [dbo].[myContentType] ([GuidContentType])
GO
ALTER TABLE [dbo].[MyContents] CHECK CONSTRAINT [FK_MyContents_myContentType1]
GO
ALTER TABLE [dbo].[MyFilterQueries]  WITH CHECK ADD  CONSTRAINT [R_42_1] FOREIGN KEY([GuidBusinessObject])
REFERENCES [dbo].[secBusinessObject] ([GuidBusinessObject])
GO
ALTER TABLE [dbo].[MyFilterQueries] CHECK CONSTRAINT [R_42_1]
GO
ALTER TABLE [dbo].[MyGeoCities]  WITH CHECK ADD  CONSTRAINT [FK_MyGeoCities_MyGeoStates] FOREIGN KEY([GuidState])
REFERENCES [dbo].[MyGeoStates] ([GuidState])
GO
ALTER TABLE [dbo].[MyGeoCities] CHECK CONSTRAINT [FK_MyGeoCities_MyGeoStates]
GO
ALTER TABLE [dbo].[MyGeoStates]  WITH CHECK ADD  CONSTRAINT [FK_MyGeoStates_MyGeoCountries] FOREIGN KEY([GuidCountry])
REFERENCES [dbo].[MyGeoCountries] ([GuidCountry])
GO
ALTER TABLE [dbo].[MyGeoStates] CHECK CONSTRAINT [FK_MyGeoStates_MyGeoCountries]
GO
ALTER TABLE [dbo].[MyProfile]  WITH CHECK ADD  CONSTRAINT [FK_MyProfile_MyGeoCities] FOREIGN KEY([GuidActualCity])
REFERENCES [dbo].[MyGeoCities] ([GuidCity])
GO
ALTER TABLE [dbo].[MyProfile] CHECK CONSTRAINT [FK_MyProfile_MyGeoCities]
GO
ALTER TABLE [dbo].[MyProfile]  WITH CHECK ADD  CONSTRAINT [FK_MyProfile_MyGeoCities1] FOREIGN KEY([GuidWorkCity])
REFERENCES [dbo].[MyGeoCities] ([GuidCity])
GO
ALTER TABLE [dbo].[MyProfile] CHECK CONSTRAINT [FK_MyProfile_MyGeoCities1]
GO
ALTER TABLE [dbo].[MyProfile]  WITH CHECK ADD  CONSTRAINT [FK_MyProfile_MyGeoCountries] FOREIGN KEY([GuidActualCountry])
REFERENCES [dbo].[MyGeoCountries] ([GuidCountry])
GO
ALTER TABLE [dbo].[MyProfile] CHECK CONSTRAINT [FK_MyProfile_MyGeoCountries]
GO
ALTER TABLE [dbo].[MyProfile]  WITH CHECK ADD  CONSTRAINT [FK_MyProfile_MyGeoCountries1] FOREIGN KEY([GuidWorkCountry])
REFERENCES [dbo].[MyGeoCountries] ([GuidCountry])
GO
ALTER TABLE [dbo].[MyProfile] CHECK CONSTRAINT [FK_MyProfile_MyGeoCountries1]
GO
ALTER TABLE [dbo].[MyProfile]  WITH CHECK ADD  CONSTRAINT [FK_MyProfile_MyGeoStates] FOREIGN KEY([GuidActualState])
REFERENCES [dbo].[MyGeoStates] ([GuidState])
GO
ALTER TABLE [dbo].[MyProfile] CHECK CONSTRAINT [FK_MyProfile_MyGeoStates]
GO
ALTER TABLE [dbo].[MyProfile]  WITH CHECK ADD  CONSTRAINT [FK_MyProfile_MyGeoStates1] FOREIGN KEY([GuidWorkState])
REFERENCES [dbo].[MyGeoStates] ([GuidState])
GO
ALTER TABLE [dbo].[MyProfile] CHECK CONSTRAINT [FK_MyProfile_MyGeoStates1]
GO
ALTER TABLE [dbo].[secBusinessObject]  WITH CHECK ADD  CONSTRAINT [FK_secBusinessObject_secModule] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secBusinessObject] CHECK CONSTRAINT [FK_secBusinessObject_secModule]
GO
ALTER TABLE [dbo].[secCompanies]  WITH CHECK ADD  CONSTRAINT [FK_ParentCompanies] FOREIGN KEY([CompanyParentGuid])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secCompanies] CHECK CONSTRAINT [FK_ParentCompanies]
GO
ALTER TABLE [dbo].[secCompanies]  WITH CHECK ADD  CONSTRAINT [FK_secCompanies_secCompanyType] FOREIGN KEY([GuidCompanyType])
REFERENCES [dbo].[secCompanyType] ([GuidCompanyType])
GO
ALTER TABLE [dbo].[secCompanies] CHECK CONSTRAINT [FK_secCompanies_secCompanyType]
GO
ALTER TABLE [dbo].[secCompanyExtraData]  WITH CHECK ADD  CONSTRAINT [FK_secCompanyExtraData_secCompanies] FOREIGN KEY([GuidCompany])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secCompanyExtraData] CHECK CONSTRAINT [FK_secCompanyExtraData_secCompanies]
GO
ALTER TABLE [dbo].[secCompanyModules]  WITH CHECK ADD  CONSTRAINT [FK_secCompanyModules_secCompanies] FOREIGN KEY([GuidCompany])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secCompanyModules] CHECK CONSTRAINT [FK_secCompanyModules_secCompanies]
GO
ALTER TABLE [dbo].[secCompanyModules]  WITH CHECK ADD  CONSTRAINT [FK_secCompanyModules_secModule] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secCompanyModules] CHECK CONSTRAINT [FK_secCompanyModules_secModule]
GO
ALTER TABLE [dbo].[secCompanyRoles]  WITH CHECK ADD  CONSTRAINT [aspnet_Roles_CompanyRoles_FK1] FOREIGN KEY([GuidRole])
REFERENCES [dbo].[secRoles] ([GuidRole])
GO
ALTER TABLE [dbo].[secCompanyRoles] CHECK CONSTRAINT [aspnet_Roles_CompanyRoles_FK1]
GO
ALTER TABLE [dbo].[secCompanyRoles]  WITH CHECK ADD  CONSTRAINT [Company_CompanyRoles_FK1] FOREIGN KEY([GuidCompany])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secCompanyRoles] CHECK CONSTRAINT [Company_CompanyRoles_FK1]
GO
ALTER TABLE [dbo].[secMenuForms]  WITH CHECK ADD  CONSTRAINT [FK_secMenuForms_secBusinessObject] FOREIGN KEY([GuidBusinessObject])
REFERENCES [dbo].[secBusinessObject] ([GuidBusinessObject])
GO
ALTER TABLE [dbo].[secMenuForms] CHECK CONSTRAINT [FK_secMenuForms_secBusinessObject]
GO
ALTER TABLE [dbo].[secMenuForms]  WITH CHECK ADD  CONSTRAINT [FK_secMenuForms_secMenuForms] FOREIGN KEY([ParentGuidForm])
REFERENCES [dbo].[secMenuForms] ([GuidForm])
GO
ALTER TABLE [dbo].[secMenuForms] CHECK CONSTRAINT [FK_secMenuForms_secMenuForms]
GO
ALTER TABLE [dbo].[secMenuForms]  WITH CHECK ADD  CONSTRAINT [FK_secMenuForms_secModule] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secMenuForms] CHECK CONSTRAINT [FK_secMenuForms_secModule]
GO
ALTER TABLE [dbo].[secMenuForms]  WITH CHECK ADD  CONSTRAINT [FK_secMenuForms_secPermission] FOREIGN KEY([GuidPermission])
REFERENCES [dbo].[secPermission] ([GuidPermission])
GO
ALTER TABLE [dbo].[secMenuForms] CHECK CONSTRAINT [FK_secMenuForms_secPermission]
GO
ALTER TABLE [dbo].[secModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [FK_secModuleObjectPermission_secBusinessObject] FOREIGN KEY([GuidBusinessObject])
REFERENCES [dbo].[secBusinessObject] ([GuidBusinessObject])
GO
ALTER TABLE [dbo].[secModuleObjectPermission] CHECK CONSTRAINT [FK_secModuleObjectPermission_secBusinessObject]
GO
ALTER TABLE [dbo].[secModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [R_50] FOREIGN KEY([GuidPermission])
REFERENCES [dbo].[secPermission] ([GuidPermission])
GO
ALTER TABLE [dbo].[secModuleObjectPermission] CHECK CONSTRAINT [R_50]
GO
ALTER TABLE [dbo].[secModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [R_51] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secModuleObjectPermission] CHECK CONSTRAINT [R_51]
GO
ALTER TABLE [dbo].[secModulePermissions]  WITH CHECK ADD  CONSTRAINT [Module_ModulePermissions_FK1] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secModulePermissions] CHECK CONSTRAINT [Module_ModulePermissions_FK1]
GO
ALTER TABLE [dbo].[secModulePermissions]  WITH CHECK ADD  CONSTRAINT [Permission_ModulePermissions_FK1] FOREIGN KEY([GuidPermission])
REFERENCES [dbo].[secPermission] ([GuidPermission])
GO
ALTER TABLE [dbo].[secModulePermissions] CHECK CONSTRAINT [Permission_ModulePermissions_FK1]
GO
ALTER TABLE [dbo].[secMoneyMovements]  WITH CHECK ADD  CONSTRAINT [FK_secMoneyMovements_secCompanies] FOREIGN KEY([GuidCompanyAdd])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secMoneyMovements] CHECK CONSTRAINT [FK_secMoneyMovements_secCompanies]
GO
ALTER TABLE [dbo].[secMoneyMovements]  WITH CHECK ADD  CONSTRAINT [FK_secMoneyMovements_secCompanies1] FOREIGN KEY([GuidCompanyCharge])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secMoneyMovements] CHECK CONSTRAINT [FK_secMoneyMovements_secCompanies1]
GO
ALTER TABLE [dbo].[secMoneyMovements]  WITH CHECK ADD  CONSTRAINT [FK_secMoneyMovements_secMoneyMovementTypes] FOREIGN KEY([GuidMoneyMovementType])
REFERENCES [dbo].[secMoneyMovementTypes] ([GuidMoneyMovementType])
GO
ALTER TABLE [dbo].[secMoneyMovements] CHECK CONSTRAINT [FK_secMoneyMovements_secMoneyMovementTypes]
GO
ALTER TABLE [dbo].[secMoneyMovements]  WITH NOCHECK ADD  CONSTRAINT [FK_secMoneyMovements_secUserPayments] FOREIGN KEY([GuidUserPayment])
REFERENCES [dbo].[secUserPayments] ([GuidUserPayment])
GO
ALTER TABLE [dbo].[secMoneyMovements] CHECK CONSTRAINT [FK_secMoneyMovements_secUserPayments]
GO
ALTER TABLE [dbo].[secMoneyMovements]  WITH CHECK ADD  CONSTRAINT [FK_secMoneyMovements_secUsers] FOREIGN KEY([GuidUserCharge])
REFERENCES [dbo].[secUsers] ([GuidUser])
GO
ALTER TABLE [dbo].[secMoneyMovements] CHECK CONSTRAINT [FK_secMoneyMovements_secUsers]
GO
ALTER TABLE [dbo].[secMoneyMovements]  WITH CHECK ADD  CONSTRAINT [FK_secMoneyMovements_secUsers1] FOREIGN KEY([GuidUserAdd])
REFERENCES [dbo].[secUsers] ([GuidUser])
GO
ALTER TABLE [dbo].[secMoneyMovements] CHECK CONSTRAINT [FK_secMoneyMovements_secUsers1]
GO
ALTER TABLE [dbo].[secRoleDataPermission]  WITH CHECK ADD  CONSTRAINT [secDataColumn_secRoleDataPermission_FK1] FOREIGN KEY([GuidDataColumn])
REFERENCES [dbo].[secDataColumn] ([GuidDataColumn])
GO
ALTER TABLE [dbo].[secRoleDataPermission] CHECK CONSTRAINT [secDataColumn_secRoleDataPermission_FK1]
GO
ALTER TABLE [dbo].[secRoleDataPermission]  WITH CHECK ADD  CONSTRAINT [secRoles_secRoleDataPermission_FK1] FOREIGN KEY([GuidRole])
REFERENCES [dbo].[secRoles] ([GuidRole])
GO
ALTER TABLE [dbo].[secRoleDataPermission] CHECK CONSTRAINT [secRoles_secRoleDataPermission_FK1]
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [FK_secRoleModuleObjectPermission_secBusinessObject] FOREIGN KEY([GuidBusinessObject])
REFERENCES [dbo].[secBusinessObject] ([GuidBusinessObject])
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission] CHECK CONSTRAINT [FK_secRoleModuleObjectPermission_secBusinessObject]
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [FK_secRoleModuleObjectPermission_secModule] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission] CHECK CONSTRAINT [FK_secRoleModuleObjectPermission_secModule]
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [FK_secRoleModuleObjectPermission_secPermission] FOREIGN KEY([GuidPermission])
REFERENCES [dbo].[secPermission] ([GuidPermission])
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission] CHECK CONSTRAINT [FK_secRoleModuleObjectPermission_secPermission]
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission]  WITH CHECK ADD  CONSTRAINT [FK_secRoleModuleObjectPermission_secRoles] FOREIGN KEY([GuidRole])
REFERENCES [dbo].[secRoles] ([GuidRole])
GO
ALTER TABLE [dbo].[secRoleModuleObjectPermission] CHECK CONSTRAINT [FK_secRoleModuleObjectPermission_secRoles]
GO
ALTER TABLE [dbo].[secRoleModulePermissions]  WITH CHECK ADD  CONSTRAINT [Module_RoleModulePermissions_FK1] FOREIGN KEY([GuidModule])
REFERENCES [dbo].[secModule] ([GuidModule])
GO
ALTER TABLE [dbo].[secRoleModulePermissions] CHECK CONSTRAINT [Module_RoleModulePermissions_FK1]
GO
ALTER TABLE [dbo].[secRoleModulePermissions]  WITH CHECK ADD  CONSTRAINT [Permission_RoleModulePermissions_FK1] FOREIGN KEY([GuidPermission])
REFERENCES [dbo].[secPermission] ([GuidPermission])
GO
ALTER TABLE [dbo].[secRoleModulePermissions] CHECK CONSTRAINT [Permission_RoleModulePermissions_FK1]
GO
ALTER TABLE [dbo].[secRoleModulePermissions]  WITH CHECK ADD  CONSTRAINT [Roles_RoleModulePermissions_FK1] FOREIGN KEY([GuidRole])
REFERENCES [dbo].[secRoles] ([GuidRole])
GO
ALTER TABLE [dbo].[secRoleModulePermissions] CHECK CONSTRAINT [Roles_RoleModulePermissions_FK1]
GO
ALTER TABLE [dbo].[secRoles]  WITH CHECK ADD  CONSTRAINT [FK_secRoles_secRoles] FOREIGN KEY([ParentGuidRole])
REFERENCES [dbo].[secRoles] ([GuidRole])
GO
ALTER TABLE [dbo].[secRoles] CHECK CONSTRAINT [FK_secRoles_secRoles]
GO
ALTER TABLE [dbo].[secUser_LoginProviders]  WITH CHECK ADD  CONSTRAINT [FK_secUser_LoginProviders_secLoginProviders] FOREIGN KEY([GuidLoginProvider])
REFERENCES [dbo].[secLoginProviders] ([GuidLoginProvider])
GO
ALTER TABLE [dbo].[secUser_LoginProviders] CHECK CONSTRAINT [FK_secUser_LoginProviders_secLoginProviders]
GO
ALTER TABLE [dbo].[secUser_LoginProviders]  WITH CHECK ADD  CONSTRAINT [R_42] FOREIGN KEY([GuidUser])
REFERENCES [dbo].[secUsers] ([GuidUser])
GO
ALTER TABLE [dbo].[secUser_LoginProviders] CHECK CONSTRAINT [R_42]
GO
ALTER TABLE [dbo].[secUserCompanies]  WITH CHECK ADD  CONSTRAINT [Companies_UserCompanies_FK1] FOREIGN KEY([GuidCompany])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secUserCompanies] CHECK CONSTRAINT [Companies_UserCompanies_FK1]
GO
ALTER TABLE [dbo].[secUserCompanies]  WITH CHECK ADD  CONSTRAINT [Users_UserCompanies_FK1] FOREIGN KEY([GuidUser])
REFERENCES [dbo].[secUsers] ([GuidUser])
GO
ALTER TABLE [dbo].[secUserCompanies] CHECK CONSTRAINT [Users_UserCompanies_FK1]
GO
ALTER TABLE [dbo].[secUserPayments]  WITH CHECK ADD  CONSTRAINT [FK_secUserPayments_secCompanies] FOREIGN KEY([GuidCompany])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secUserPayments] CHECK CONSTRAINT [FK_secUserPayments_secCompanies]
GO
ALTER TABLE [dbo].[secUserPayments]  WITH CHECK ADD  CONSTRAINT [FK_secUserPayments_secPaymentMethods] FOREIGN KEY([GuidPaymentMethod])
REFERENCES [dbo].[secPaymentMethods] ([GuidPaymentMethod])
GO
ALTER TABLE [dbo].[secUserPayments] CHECK CONSTRAINT [FK_secUserPayments_secPaymentMethods]
GO
ALTER TABLE [dbo].[secUserPayments]  WITH CHECK ADD  CONSTRAINT [FK_secUserPayments_secUsers] FOREIGN KEY([GuidUser])
REFERENCES [dbo].[secUsers] ([GuidUser])
GO
ALTER TABLE [dbo].[secUserPayments] CHECK CONSTRAINT [FK_secUserPayments_secUsers]
GO
ALTER TABLE [dbo].[secUserRoles]  WITH CHECK ADD  CONSTRAINT [FK_UserRoles_Roles] FOREIGN KEY([GuidRole])
REFERENCES [dbo].[secRoles] ([GuidRole])
GO
ALTER TABLE [dbo].[secUserRoles] CHECK CONSTRAINT [FK_UserRoles_Roles]
GO
ALTER TABLE [dbo].[secUserRoles]  WITH CHECK ADD  CONSTRAINT [FK_UserRoles_Users] FOREIGN KEY([GuidUser])
REFERENCES [dbo].[secUsers] ([GuidUser])
GO
ALTER TABLE [dbo].[secUserRoles] CHECK CONSTRAINT [FK_UserRoles_Users]
GO
ALTER TABLE [dbo].[secUsers]  WITH CHECK ADD  CONSTRAINT [FK_secUsers_secCompanies] FOREIGN KEY([GuidCompany])
REFERENCES [dbo].[secCompanies] ([GuidCompany])
GO
ALTER TABLE [dbo].[secUsers] CHECK CONSTRAINT [FK_secUsers_secCompanies]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Si es verdadero se trata de dinero si es falso se trada de una salida' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'secMoneyMovementTypes'
GO
